#include <iostream>
#include <stdio.h>
using namespace std;

#include "Aquarium.h"

string getFishType() {
	cout<< endl << "Please select type of fish: " << endl;
	int choice = 0;
	while (choice <=0 || choice > 3) {
		cout<<"1 - Buri" << endl;
		cout<<"2 - Lockus" << endl;
		cout<<"3 - exit" << endl;
		
		cin >> choice;
		cin.clear();
	}
	switch(choice) {
			case 1: /*Buri*/
				return string("Buri");
			case 2: /*Lockus*/
				return string("Lockus");
			case 3: /*exit*/
				break;
	}
	return string("exit");
};

int main()
{
	int choice = 0;
	Aquarium* aquarium = Aquarium::getAquarium();

	while (choice != 7 /*exit*/) {
		cout<< endl << "Please select an option: " << endl;
		choice = 0;
		while (choice <=0 || choice > 7) {
			cout<<"1 - feed" << endl;
			cout<<"2 - pause/play" << endl;
			cout<<"3 - add fish" << endl;
			cout<<"4 - remove fish" << endl;
			cout<<"5 - debug" << endl;
			cout<<"6 - empty aquarium" << endl;
			cout<<"7 - exit" << endl;

			cin >> choice;
			cin.clear();
		}
		string fishType;
		switch(choice) {
			case 1: /*feed*/
				aquarium->feed();
				break;
			case 2: /*pause/play*/
				aquarium->pausePlay();
				break;
			case 3: /*add fish*/
				fishType = getFishType();
				if (fishType == "exit"){
					choice = 7;
					break;
				}
				aquarium->addFish(fishType);
				break;
			case 4: /*remove fish*/
				fishType = getFishType();
				if (fishType == "exit"){
					choice = 7;
					break;
				}
				aquarium->removeFish(fishType);
				break;
			case 5: /*debug*/
				aquarium->debug();
				break;
			case 6: /*empty aquarium*/
				aquarium->empty();
				break;
			case 7: /*exit*/
				continue;
		}
	}

}
